var o, e = require, t = module, n = exports, i = this && this.__extends || (o = function(t, e) {
    return (o = Object.setPrototypeOf || {
        __proto__: []
    } instanceof Array && function(t, e) {
        t.__proto__ = e;
    } || function(t, e) {
        for (var i in e) e.hasOwnProperty(i) && (t[i] = e[i]);
    })(t, e);
}, function(t, e) {
    function i() {
        this.constructor = t;
    }
    o(t, e), t.prototype = null === e ? Object.create(e) : (i.prototype = e.prototype, 
    new i());
}), a = this && this.__decorate || function(t, e, i, r) {
    var n, o = arguments.length, c = o < 3 ? e : null === r ? r = Object.getOwnPropertyDescriptor(e, i) : r;
    if ("object" == typeof Reflect && "function" == typeof Reflect.decorate) c = Reflect.decorate(t, e, i, r); else for (var a = t.length - 1; 0 <= a; a--) (n = t[a]) && (c = (o < 3 ? n(c) : 3 < o ? n(e, i, c) : n(e, i)) || c);
    return 3 < o && c && Object.defineProperty(e, i, c), c;
};

Object.defineProperty(n, "__esModule", {
    value: !0
});

var r = e("ActivityManager"), s = e("EggsManager"), c = e("LoadManager"), l = e("MyButton"), d = cc._decorator, u = d.ccclass, p = d.property, h = function(e) {
    function t() {
        var t = null !== e && e.apply(this, arguments) || this;
        return t.itemSprite = null, t.titleSprite = null, t.myButton = null, t.already = null, 
        t.id = 0, t.type = r.ActivityType.FIRST, t;
    }
    return i(t, e), t.prototype.start = function() {}, t.prototype.init = function(t) {
        if (this.id = t.id, this.type = t.type, c.default.getInstance().loadSpriteFrame({
            url: t.skinPath,
            sprite: this.itemSprite
        }), c.default.getInstance().loadSpriteFrame({
            url: t.titlePath,
            sprite: this.titleSprite
        }), r.ActivityManager.getInstance().checkActivity(this.type)) this.refresh(); else {
            var e = "初一开启";
            switch (this.type) {
              case r.ActivityType.FIRST:
                e = "初一开启";
                break;

              case r.ActivityType.SECOND:
                e = "初二开启";
                break;

              case r.ActivityType.THIRD:
                e = "初三开启";
                break;

              case r.ActivityType.FOURTH:
                e = "初四开启";
                break;

              case r.ActivityType.FIFTH:
                e = "初五开启";
                break;

              case r.ActivityType.SISTH:
                e = "初六开启";
                break;

              case r.ActivityType.SEVENTH:
                e = "初七开启";
            }
            this.myButton.init("newActivityTips", e, l.BtnBgType.GRAY, l.BtnIconType.NORMAL);
        }
    }, t.prototype.refresh = function() {
        -1 == s.default.getInstance().checkEggPerson(this.id) ? (this.myButton.init("newActivityHint", "获取提示"), 
        this.already.active = !1) : -1 < s.default.getInstance().checkEggPerson(this.id) && (this.myButton.init("newActivityTry", "再次试用"), 
        this.already.active = !0);
    }, a([ p(cc.Sprite) ], t.prototype, "itemSprite", void 0), a([ p(cc.Sprite) ], t.prototype, "titleSprite", void 0), 
    a([ p(l.default) ], t.prototype, "myButton", void 0), a([ p(cc.Node) ], t.prototype, "already", void 0), 
    a([ u ], t);
}(cc.Component);

n.default = h;